package com.bocloud.cmp.entity.resource;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 资源事件实体类
 * 
 * @author dongkai
 *
 */
@Table("resource_event")
public class ResourceEvent {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("vm_id")
	private Long vmId; // 资源ID
	@Column("content")
	private String content; // 操作内容
	@Column("result")
	private String result;// 操作结果
	@Column("operator_id")
	private Long operatorId; // 操作者ID
	@IgnoreAll
	private String operator; // 操作者
	@Column("gmt_operate")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtOperate;
	@Column("object")
	private String object; // 操作对象

	public ResourceEvent() {

	}

	public ResourceEvent(Long vmId, String content, String result, Long operatorId, Date gmtOperate, String object) {
		super();
		this.vmId = vmId;
		this.content = content;
		this.result = result;
		this.operatorId = operatorId;
		this.gmtOperate = gmtOperate;
		this.object = object;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	public Long getVmId() {
		return vmId;
	}

	public void setVmId(Long vmId) {
		this.vmId = vmId;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content
	 *            the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the result
	 */
	public String getResult() {
		return result;
	}

	/**
	 * @param result
	 *            the result to set
	 */
	public void setResult(String result) {
		this.result = result;
	}

	/**
	 * @return the operatorId
	 */
	public Long getOperatorId() {
		return operatorId;
	}

	/**
	 * @param operatorId
	 *            the operatorId to set
	 */
	public void setOperatorId(Long operatorId) {
		this.operatorId = operatorId;
	}

	/**
	 * @return the operator
	 */
	public String getOperator() {
		return operator;
	}

	/**
	 * @param operator
	 *            the operator to set
	 */
	public void setOperator(String operator) {
		this.operator = operator;
	}

	/**
	 * @return the gmtOperate
	 */
	public Date getGmtOperate() {
		return gmtOperate;
	}

	/**
	 * @param gmtOperate
	 *            the gmtOperate to set
	 */
	public void setGmtOperate(Date gmtOperate) {
		this.gmtOperate = gmtOperate;
	}

	/**
	 * @return the object
	 */
	public String getObject() {
		return object;
	}

	/**
	 * @param object
	 *            the object to set
	 */
	public void setObject(String object) {
		this.object = object;
	}

}
